<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="crm.model.Product_system"%>
<%@page import="crm.control.ProductControl"%>
<%@page import="crm.util.ParamUtil"%>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Calendar" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>   
    <title>My JSP 'product_system_update_do.jsp' starting page</title>
  </head>
  
  <body>
    <%
         request.setCharacterEncoding("UTF-8");
         Product_system productSystem=new Product_system();
         
         int id=Integer.parseInt(request.getParameter("id"));
         productSystem=ProductControl.getProductSystemById(id);
         
         String system_name=ParamUtil.getString(request,"product_system_name");
         productSystem.setSystem_name(system_name);
         
         String system_number=ParamUtil.getString(request,"product_system_number");
         productSystem.setSystem_number(system_number);
         
         String system_price=ParamUtil.getString(request,"product_system_price");
         productSystem.setPrice(system_price);
         
         String system_develope_department=ParamUtil.getString(request,"product_system_develope_department");
         productSystem.setDevelope_department(system_develope_department);
         
         String system_developer=ParamUtil.getString(request,"product_system_developer");
         productSystem.setDeveloper(system_developer);
         
         //String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
         String create_time=ParamUtil.getString(request,"product_model_create_time");
         productSystem.setCreate_time(create_time);
         
         String description=ParamUtil.getString(request,"product_system_description");
         productSystem.setDescription(description);
    

   			if (ProductControl.updateProductSystem(id)){
		%>
		<script type="text/javascript">
if (window.confirm("修改成功！"))
	window.location.href = "product_system.jsp";
	else
    window.location.href = "product_system.jsp";
</script>
		<%
			} else {
		%>
		<script type="text/javascript">
if (window.confirm("修改失败！"))
	window.location.href = "product_system.jsp";
	else
    window.location.href = "product_system.jsp";
</script>
		<%
			}
			%>
  </body>
</html>
